// config/index.js
import { MNP_REQUEST_DEFAULT_CONFIG_TYPING } from '../typings'
import { MOCK_BASE_URL } from '../consts/api'

export const isProduction = process.env.NODE_ENV === 'production'
export const NODE_ENV = process.env.NODE_ENV || 'prod'

// axios 默认配置
export const MNP_REQUEST_DEFAULT_CONFIG: MNP_REQUEST_DEFAULT_CONFIG_TYPING = {
  timeout: 20000,
  maxContentLength: 2000,
  baseURL: isProduction
    ? ''
    : MOCK_BASE_URL,
  headers: {}
}

// API 默认配置
export const API_DEFAULT_CONFIG = {
  // mockBaseURL: '',
  mockBaseURL: MOCK_BASE_URL,
  mock: false,
  debug: false,
  sep: '/'
}